import { combineReducers } from 'redux';
import { fork, all } from 'redux-saga/effects';
// import { AdminManage, adminManageState, adminManageSaga } from './AdminManage';
import { MenuManage, menuMangeSaga, menuManageState } from './MenuManage';
import { DepartmentManage, departmentManageState, departmentManageSaga } from './DepartmentManage';
import { RoleManage, roleManageState, roleMangeSaga } from './RoleManage';
import { PeopleManage, peopleManageSaga, peopleManageState } from './PeopleManage';
import { FeedbackManage, feedbackManageSaga, feedbackManageState } from './FeedbackManage';

const systemManageRoutes = [
    // { path: '/adminManage', component: AdminManage },
    { path: '/menuManage', component: MenuManage },
    { path: '/departmentManage', component: DepartmentManage },
    { path: '/roleManage', component: RoleManage },
    { path: '/peopleManage', component: PeopleManage },
    { path: '/feedbackManage', component: FeedbackManage }
];

const systemManageMenuList = [
    {
        title: '系统管理',
        key: '/systemManage',
        icon: 'setting',
        children: [
            {
                title: '部门管理',
                key: '/departmentManage',
                icon: 'team'
            },
            {
                title: '角色管理',
                key: '/roleManage',
                icon: 'disconnect'
            },
            {
                title: '人员管理',
                key: '/peopleManage',
                icon: 'user-add'
            },
            {
                title: '用户反馈',
                key: '/feedbackManage',
                icon: 'solution'
            }
        ]
    }
];
const systemManageState = combineReducers({
    menuManageState,
    departmentManageState,
    roleManageState,
    peopleManageState,
    feedbackManageState

})
function* systemManageSaga() {
    yield all([
        fork(menuMangeSaga),
        fork(departmentManageSaga),
        fork(roleMangeSaga),
        fork(peopleManageSaga),
        fork(feedbackManageSaga)
    ])
}
export { systemManageRoutes, systemManageMenuList, systemManageState, systemManageSaga };